package edu.sctu.zhuyingzhi.month201506.day20150607.test;

/**
 * Created by user13 on 2015/6/7.
 */
import java.util.Timer;
import java.util.TimerTask;
public class TimeTask {
    public static void main(String[] args) {
        TimeTask tTask = new TimeTask();
        tTask.timeVoid();
    }

    public void timeVoid() {
        final Timer timer = new Timer();
        TimerTask tt = new TimerTask() {
            @Override
            public void run() {
                System.out.println("到点啦！");
                timer.cancel();
            }
        };
        timer.schedule(tt, 6000);
    }
}
